import request from '@/config/axios'

// BPM 流程分类 VO
export interface CategoryVO {
  id: number // 分类编号
  name: string // 分类名
  code: string // 分类编码
  description: string // 分类描述
  status: number // 状态
  sort: number // 排序
}


// BPM 流程分类 API
export const CategoryApi = {
  // 获取BPM 流程分类简要列表
  getCategorySimpleList: async (status?: number) => {
    return await request.get({ url: `/bpm/category/simple-list`, params: { status } })
  },

  // 获取BPM 流程分类分页
  getCategoryPage: async (params: PageParam) => {
    return await request.get({ url: `/bpm/category/page`, params })
  },

  // 获取BPM 流程分类详情
  getCategory: async (id: number) => {
    return await request.get({ url: `/bpm/category/get`, params: { id } })
  },

  // 新增BPM 流程分类
  createCategory: async (data: CategoryVO) => {
    return await request.post({ url: `/bpm/category/create`, data })
  },

  // 修改BPM 流程分类
  updateCategory: async (data: CategoryVO) => {
    return await request.post({ url: `/bpm/category/update`, data })
  },

  // 删除BPM 流程分类
  deleteCategory: async (id: number) => {
    return await request.delete({ url: `/bpm/category/delete`, params: { id } })
  }
}
